home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 154 / 154.d81 / six pawns (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1997-01-01  |  6.2 KB  |  184 lines

  1. 10 poke53281,10:poke53280,0:poke646,0:poke53272,31
  2. 12 dv=peek(186):ifdv<8thendv=8
  3. 20 :
  4. 30 rem  title screen
  5. 40 :
  6. 50 print"[147][176][192][192][174]   [146][176][192][192][174]   [146][176][192][192][174]    [146][176][192][192][174]   [146][176][192][192][174]   [146][176][192][192][174]";
  7. 60 print"[221]  [173][192][192][192][189]  [173][192][192][192][189]  [173][192][192][192][192][189]  [173][192][192][192][189]  [173][192][192][192][189]  [221]";
  8. 70 print"[221]      [162] [146][162]    [176][178][178][174][176][174][176][174][176][174][144]               [221]";
  9. 80 print"[173][174]        [146]    [221][221][173][189][221][221][173][219][219][189][144]              [176][189]";
  10. 90 print" [146][221]     [190] [188][146]    [173][177][178][174][221][221] [221][221][144]               [221] [146]";
  11. 100 print" [146][221]   [172][190]   [188][146][187]  [176][174][221][221][221][221][176][219][219][174][144]              [221] [146]";
  12. 110 print"[176][189]    [188]   [146][190]   [173][177][177][189][173][189][173][189][173][189][144]              [173][174]";
  13. 120 print"[221]         [146]    [176][178][178][174][176][178][178][174][176][174] [176][174][176][174][176][174][176][178][178][174][144]    [221]";
  14. 130 print"[173][174]        [146]    [221][221][221][221][221][221][221][221][221][221] [221][221][221][173][179][221][221][221][173][189][144]   [176][189]";
  15. 140 print" [146][221]   [172][190]   [188][146][187]  [221][171][177][189][221][171][179][221][221][221][221][221][221][221]  [221][173][177][178][174][144]   [221] [146]";
  16. 150 print" [146][221]  [190]       [188][146] [221][221]  [221][221][221][221][221][221][221][221][221][221][171][174][221][176][174][221][221][144]   [221] [146]";
  17. 160 print"[176][189]  [187]       [172][146] [173][189]  [173][189][173][189][173][177][177][177][189][173][189][173][189][173][177][177][189][144]   [173][174]";
  18. 170 print"[221]                                      [221]";
  19. 180 print"[173][174]     [176][178][178][174][176][174][176][174][176][178][178][174][176][178][178][174][176][178][178][174]    [162] [146][162][144]    [176][189]";
  20. 190 print" [146][221]     [221][221][173][189][221][221][221][221][221][221][173][189][221][221][173][189][221][221][173][189]       [146][144]    [221] [146]";
  21. 200 print" [146][221]     [221][221]  [221][171][179][221][221][171][192] [173][177][178][174][173][177][178][174]    [190] [188][146][144]    [221] [146]";
  22. 210 print"[176][189]     [221][221][176][174][221][221][221][221][221][221][176][174][176][174][221][221][176][174][221][221]  [172][190]   [188][146][187][144]  [173][174]";
  23. 220 print"[221]      [173][177][177][189][173][189][173][189][173][177][177][189][173][177][177][189][173][177][177][189]   [188]   [146][190][144]    [221]";
  24. 230 print"[173][174] [176][178][178][174][176][174][176][174][176][178][178][174][176][178][178][174][176][174]  [176][178][178][174]       [146][144]    [176][189]";
  25. 240 print" [146][221] [221][221][221][221][221][221][221][221][173][189][221][221][173][189][221][221][221][221]  [221][221][173][189]       [146][144]    [221] [146]";
  26. 250 print" [146][221] [221][171][177][189][221][221][221][221][176][178][177][189][176][178][177][189][221][221]  [221][171][192]   [172][190]   [188][146][187][144]  [221] [146]";
  27. 260 print"[176][189] [221][221]  [221][221][221][221][221][221][176][174][221][221][176][174][221][221][176][174][221][221][176][174] [190]       [188][146][144] [173][174]";
  28. 270 print"[221]  [173][189]  [173][177][177][189][173][177][177][189][173][177][177][189][173][177][177][189][173][177][177][189] [187]       [172][146][144]  [221]";
  29. 280 print"[221]  [176][192][192][192][174]  [176][192][192][192][174]  [176][192][192][192][192][174]  [176][192][192][192][174]  [176][192][192][192][174]  [221]";
  30. 290 print"[173][192][192][189]   [146][173][192][192][189]   [146][173][192][192][189]    [146][173][192][192][189]   [146][173][192][192][189]   [146][173][192][189][157][148][192]";
  31. 299 fori=217to242:pokei,peek(i)or128:next
  32. 300 tq=0:poke53370,0
  33. 302 tq=tq+1:geta$:ifa$=""andtq<200then302
  34. 304 poke53371,0
  35. 310 :
  36. 320 rem  instruction screen
  37. 330 :
  38. 340 print"[147][144]      [170][146][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174][180]      [146]";
  39. 350 print"[176][192][192][192][192][192][192][189] [211][201][216] [208][193][215][206][211] [195][200][197][211][211] [208][213][218][218][204][197][144] [173][192][192][192][192][192][192][174]";
  40. 360 print"[144] [212]o begin,  three black pawns and three
  41. 370 [153]" white pawns are  positioned  on either
  42. 380 print" end of a one by seven gameboard grid.
  43. 390 [153]"     ortantantan=tantantan=tantantan=tantantantan=tantantan=tantantan=tantantan^
  44. 400 print"     [221][144][172] [146][187][221][144][172] [146][187][221][144][172] [146][187][221]    [221][172] [146][187][221][172] [146][187][221][172] [146][187][221]
  45. 410 [153]"     (NULL)stop* waitrnd(NULL)stop* waitrnd(NULL)stop* waitrnd(NULL)    (NULL)* waitrnd(NULL)* waitrnd(NULL)* waitrnd(NULL)
  46. 420 print"     [173][192][192][192][177][192][192][192][177][192][192][192][177][192][192][192][192][177][192][192][192][177][192][192][192][177][192][192][192][189][144]
  47. 430 [153]" (NULL)he three black pawns are permitted to
  48. 440 print" move  only to the right  and the three
  49. 450 [153]" white pawns are permitted to move only
  50. 460 print" to the left.   [208]awns may slide into an
  51. 470 [153]" adjacent  empty cell  or jump over one
  52. 480 print" adjacent pawn of opposite color into a
  53. 490 [153]" following empty cell.
  54. 500 print" [212]he goal is to exchange  the positions
  55. 510 [153]" of the six pawns  with the black pawns
  56. 520 print" ending on the right side and the white
  57. 530 [153]" pawns ending on the left side.
  58. 540 print" [208]ress any key to begin.";
  59. 542 fori=217to242:pokei,peek(i)or128:next
  60. 550 poke198,0:wait198,1:gets$:poke198,0
  61. 560 :
  62. 570 rem  gameboard screen
  63. 580 :
  64. 590 print"[147]";:poke53281,0:poke53280,10
  65. 592 dv=peek(186):ifdv<8thendv=8
  66. 600 m=0:c(0)=2:fori=1to3:c(i)=1:c(i+4)=-1:next:c(4)=0:c(8)=2
  67. 610 print"[147][158]        [176][192][174][178][176][174][174]  [176][192][174][176][192][174][176] [174][176][174][174][176][192][174]        ";
  68. 620 print"        [173][192][174][221][176][219][189]  [171][192][189][171][192][179][221][221][221][221][221][221][173][192][174]        ";
  69. 630 print"        [173][192][189][177][173][173][189]  [173]  [173] [189][173][177][189][173][173][189][173][192][189]
  70. 640 [153]" def ortantantantan=tantantantan=tantantantan=tantantantan=tantantantan=tantantantan=tantantantan^ "
  71. 650 [153]" def (NULL)1   defwait(NULL)2   defwait(NULL)3   defwait(NULL)4   defwait(NULL)5   defwait(NULL)6   defwait(NULL)7   defwait(NULL)"
  72. 660 [153]" def (NULL)    defwait(NULL)    defwait(NULL)    defwait(NULL)    defwait(NULL)    defwait(NULL)    defwait(NULL)    defwait(NULL)"
  73. 670 [153]" def (NULL)    defwait(NULL)    defwait(NULL)    defwait(NULL)    defwait(NULL)    defwait(NULL)    defwait(NULL)    defwait(NULL)"
  74. 680 [153]" def /tantantantan>tantantantan>tantantantan>tantantantan>tantantantan>tantantantan>tantantantanexp"
  75. 690 [153]"            (NULL)ove (NULL)umber:"
  76. 700 [129]i[178]1[164]7:[153]"def                                        wait";:[130]
  77. 702 [129]i[178]217[164]242:[151]i,[194](i)[176]128:[130]
  78. 704 [151]214,17:[153]:[153]"def            (NULL)ress (NULL) to (NULL)uit
  79. 710 s$="                                       "
  80. 720 :
  81. 730 rem  sprite creation
  82. 740 :
  83. 750 s=53248:fori=0to62:readn:poke832+i,n:next
  84. 760 fori=2040to2047:pokei,13:next
  85. 770 fori=1to3:pokes+39+i,0:pokes+43+i,1:next
  86. 780 fori=3to15step2:pokes+i,92:next
  87. 790 fori=2to12step2:pokes+i,12+i*20:next
  88. 800 pokes+16,128:pokes+14,36
  89. 810 pokes+29,0:pokes+23,0:pokes+21,238
  90. 820 :
  91. 830 rem  input move color
  92. 840 :
  93. 850 m=m+1:p=1449:gosub1240:print""m
  94. 860 p=1824:gosub1240:fori=1to4:prints$:next
  95. 870 p=1834:gosub1240:print"[154][205]ove [195]olor ([194][154]/[215][154]):  [157]";:gosub1310:c$=g$
  96. 880 ifc$="w"orc$="[215]"then940
  97. 890 ifc$="b"orc$="[194]"then1090
  98. 900 goto860
  99. 910 :
  100. 920 rem  input white move
  101. 930 :
  102. 940 poke198,0:p=1864:gosub1240:prints$:p=1874:gosub1240:print"[154][205]ove [198]rom:  [157]";
  103. 950 gosub1310:f$=g$:wf=val(f$):ifwf<1orwf>7then940
  104. 960 ifc(wf)<>-1then940
  105. 970 poke198,0:p=1904:gosub1240:prints$:p=1914:gosub1240:print"[154][205]ove [212]o:  [157]";
  106. 980 gosub1310:t$=g$:wt=val(t$):ifwt<1orwt>7thenp=1944:gosub1240:prints$:goto940
  107. 990 ifwt=wf-1andc(wt)=0then1020
  108. 1000 ifwt=wf-2andc(wt)=0andc(wf-1)=1then1020
  109. 1010 p=1952:gosub1240:print"    [205]ove [206]ot [208]ossible    "
  110. 1012 poke53370,0:fori=0to1000:next:poke53371,0
  111. 1014 goto860
  112. 1020 c(wf)=0:pokes+21,peek(s+21)and(255-2^wf)
  113. 1030 c(wt)=-1:pokes+39+wt,1:pokes+21,peek(s+21)or(2^wt)
  114. 1040 gosub1470:gosub1390:iff=1then850
  115. 1050 goto1500
  116. 1060 :
  117. 1070 rem  input black move
  118. 1080 :
  119. 1090 poke198,0:p=1864:gosub1240:prints$:p=1874:gosub1240:print"[154][205]ove [198]rom:  [157]";
  120. 1100 gosub1310:f$=g$:bf=val(f$):ifbf<1orbf>7then1090
  121. 1110 ifc(bf)<>1then1090
  122. 1120 poke198,0:p=1904:gosub1240:prints$:p=1914:gosub1240:print"[154][205]ove [212]o:  [157]";
  123. 1130 gosub1310:t$=g$:bt=val(t$):ifbt<1orbt>7thenp=1944:gosub1240:prints$:goto1090
  124. 1140 ifbt=bf+1andc(bt)=0then1170
  125. 1150 ifbt=bf+2andc(bt)=0andc(bf+1)=-1then1170
  126. 1160 p=1952:gosub1240:print"    [205]ove [206]ot [208]ossible    "
  127. 1162 poke53370,0:fori=0to1000:next:poke53371,0
  128. 1164 goto860
  129. 1170 c(bf)=0:pokes+21,peek(s+21)and(255-2^bf)
  130. 1180 c(bt)=1:pokes+39+bt,0:pokes+21,peek(s+21)or(2^bt)
  131. 1190 gosub1470:gosub1390:iff=1then850
  132. 1200 goto1500
  133. 1210 :
  134. 1220 rem  cursor position subroutine
  135. 1230 :
  136. 1240 p=p-1024:print"";:py=int(p/40):px=p-40*py
  137. 1250 ifpy<>0thenforr=1topy:print"";:next
  138. 1260 ifpx<>0thenforr=1topx:print"";:next
  139. 1270 p=p+1024:return
  140. 1280 :
  141. 1290 rem  get subroutine
  142. 1300 :
  143. 1310 poke198,0:print"";
  144. 1320 poke204,0:poke207,0
  145. 1330 getg$:ifg$=""then1320
  146. 1332 ifg$="q"thenpoke204,1:goto1520
  147. 1340 ifg$="b"theng$="[194]"
  148. 1342 ifg$="w"theng$="[215]"
  149. 1350 printg$:poke204,1:return
  150. 1360 :
  151. 1370 rem  move check subroutine
  152. 1380 :
  153. 1390 f=0:fori=1to6:ifc(i)=1andc(i+1)=0thenf=1:i=6:goto1430
  154. 1400 ifc(i)=1andc(i+1)=-1andc(i+2)=0thenf=1:i=6:goto1430
  155. 1410 ifc(i+1)=-1andc(i)=0thenf=1:i=6:goto1430
  156. 1420 ifc(i+1)=-1andc(i)=1andc(i-1)=0thenf=1:i=6
  157. 1430 next:return
  158. 1440 :
  159. 1450 rem  game check subroutine
  160. 1460 :
  161. 1470 ifc(1)=-1andc(2)=-1andc(3)=-1andc(5)=1andc(6)=1andc(7)=1then1490
  162. 1480 return
  163. 1490 p=1874:gosub1240:print"[195]ongratulations!":goto1510
  164. 1500 p=1874:gosub1240:print"[206]o [205]ore [205]oves [208]ossible!"
  165. 1510 p=1834:gosub1240:prints$:p=1904:gosub1240:prints$
  166. 1520 poke198,0:p=1952:gosub1240
  167. 1522 print"[154](1[154]) [193]gain  (2[154]) [212]o [209][213][193][210][212][207]
  168. 1524 [151]198,0
  169. 1526 [161]a$:[139]a$[179]"1"[176]a$[177]"2"[167]1526
  170. 1528 [151]s[170]21,0:[139]a$[178]"1"[167][138]590
  171. 1530 [137]4000
  172. 1560 :
  173. 1570 [143]  sprite data
  174. 1580 :
  175. 1590 [131] 0,24,0,0,60,0,0,126,0,0,126,0,0,60,0,0,126,0,0,255,0,3,255,192
  176. 1600 [131] 0,255,0,0,126,0,0,126,0,0,126,0,0,126,0,0,126,0,0,126,0,0,255,0
  177. 1610 [131] 3,255,192,15,255,240,31,255,248,31,255,248,15,255,240
  178. 4000 [153]"load":[151]53281,0
  179. 4010 [151]214,12:[153]:[153][163]8)"open(NULL)oading lenleft$val(NULL)(NULL) (NULL)(NULL)atn(NULL)(NULL)(NULL)"
  180. 4020 [153]"stop load"[199](34)"b.chess quarto"[199](34)","dv
  181. 4030 [153]" run"
  182. 4040 [151]631,13:[151]632,13:[151]198,2:[128]
  183. 10000 d[178][194](186):n$[178]"six pawns":[159]15,d,15,"s0:"[170]n$:[160]15:[148]n$,d:[128]
  184.